<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
	<style type="text/css">
		
	</style>
</head>
	<body class="body">
		<div class="container">
			<div class="row">			
				<div class="span9">	
					<div class="well" style="border-radius:0px;border-top:none;margin-top:80px;">
						<h3>为你的任务编辑或添加新的类别</h3>
						<hr>
						<div style="background-color:#D7E6F0">
						<br>
							<span>&nbsp;&nbsp;&nbsp;&nbsp;添加一个新的类别</span>
							<form action="addtype.action" method="post" class="well form-inline" style="background-color:#D7E6F0">
								<input type="text" name="tasktype.keya">&nbsp;&nbsp;
								<input type="hidden" name="tasktype.userid" value="${session.nowUser.id }"/>
								<button type="submit"> 添加</button>
							</form>
						</div>	
						<div>
							<table class="table">
								<tbody>
								  <c:forEach items="${typelist }" var="tasktype">
								   <tr>
								     <td width="70%">${tasktype.keya}</td>
								     <td>
								     	
								     	<div class="modal hide fade" id="myModal" >
										  <div class="modal-header">
										    <a class="close" data-dismiss="modal">×</a>
										    <h3>修改类别</h3>
										  </div>
										  <form action="addtype.action" class="well form-inline" method="post">
										  		<input type="text" name="tasktype.keya" value="${tasktype.keya }">&nbsp;&nbsp;
										  		<input type="hidden" name="tasktype.userid" value="${session.nowUser.id }"/>
										  		<input type="hidden" name="tasktype.id" value="${tasktype.id}">
												<button type="submit"> 修改</button>
										  </form>
										  
										</div>
										<a href="tasktype.action?id=${tasktype.id}">
											<a href="#myModal" data-toggle="modal" >修改</a>
										</a>
								     </td>
								     <td>
								     	<a href="deltasktype.action?id=${tasktype.id}">删除</a>
								     </td>
								   </tr>
								 </c:forEach>
								</tbody>
							</table>
						</div>
						<a style="margin-left:550px" href="main.action">←返回首页</a>			
					</div>
				</div>					
			</div>
		</div>
	<script src="js/bootstrap-modal.js" type="text/javascript"></script>
	<script src="js/jquery.js" type="text/javascript"></script>
	<script src="js/bootstrap-transition.js" type="text/javascript"></script>
	<script src="js/bootstrap.min.js" type="text/javascript"></script>
	<script type="text/javascript">
	$(function(){ 
		$('#myModal').modal({
   		 backdrop:true,
   		 keyboard:false,
   		 show:false
		});
		
	});
		
	</script>
	</body>
</html>